Completed
Push — master ( 12c703...196755 )
by Justin
02:02
created

PlaceDescription.js ➔ ... ➔ it(ꞌCreate with JSONꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
var assert = require('chai').assert,
2
    GedcomX = require('../../');
3
4
describe('PlaceDescription', function(){
5
  
6
  var json = {
7
    display: {
8
      name: 'place name',
9
      fullName: 'place name, in a place',
10
      type: 'place type'
11
    }
12
  };
13
  
14
  it('Create with JSON', function(){
15
    test(GedcomX.PlaceDescription(json));
16
  });
17
  
18
  it('Build', function(){
19
    test(GedcomX.PlaceDescription()
20
      .setDisplay(json.display));
21
  });
22
  
23
  it('toJSON', function(){
24
    assert.deepEqual(GedcomX.PlaceDescription(json).toJSON(), json);
25
  });
26
  
27
});
28
29
function test(description){
30
  var display = description.getDisplay();
31
  assert.equal(display.getName(), 'place name');
32
  assert.equal(display.getFullName(), 'place name, in a place');
33
  assert.equal(display.getType(), 'place type');
34
}